﻿<UserControl x:Class="Frontend.TodoControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:src="clr-namespace:Frontend"
             mc:Ignorable="d" 
             d:DesignHeight="366" d:DesignWidth="725">
    <UserControl.Resources>
        <Style x:Key="GroupNameStyle" >
            <Setter Property="TextBlock.TextAlignment" Value="Center" />
            <Setter Property="TextBlock.TextWrapping" Value="Wrap" />
            <Setter Property="TextBlock.FontSize" Value="15" />
        </Style>
        <Style TargetType="{x:Type GroupBox}">
            <Setter Property="GroupBox.Padding" Value="10" />
            <Setter Property="GroupBox.Margin" Value="3" />
            <Setter Property="GroupBox.BorderThickness" Value="2" />
            <Setter Property="GroupBox.BorderBrush" Value="Gray" />            
        </Style>
        <Style x:Key="HeaderStyle">
            <Setter Property="TextBlock.TextAlignment" Value="Center" />
            <Setter Property="TextBlock.TextWrapping" Value="Wrap" />
            <Setter Property="TextBlock.Margin" Value="2 20" />
            <Setter Property="TextBlock.FontSize" Value="15" />
        </Style>
        <Style x:Key="ButtonStyle">
            <Setter Property="Button.Margin" Value="5 10" />
            <Setter Property="Button.Padding" Value="20 2" />
            <Setter Property="Button.FontSize" Value="12" />
            <Setter Property="Button.FontWeight" Value="DemiBold" />
        </Style>
    </UserControl.Resources>
    <ScrollViewer VerticalScrollBarVisibility="Auto">        
        <StackPanel>
            <GroupBox Name="TodoGroup">
                <GroupBox.Header>
                    <TextBlock Style="{StaticResource ResourceKey=GroupNameStyle}">
                        Changed classes
                    </TextBlock>
                </GroupBox.Header>
                <StackPanel Name="TodoPanel">
                    <StackPanel Name="TodoPanel_NoPendingChanges">
                        <TextBlock Style="{StaticResource ResourceKey=HeaderStyle}">
                            No pending changes
                        </TextBlock>
                    </StackPanel>
                    <StackPanel Name="TodoPanel_PendingChanges">
                        <src:TodoGrid x:Name="TodoGrid" />
                    
                        <StackPanel Orientation="Horizontal" Name="TodoButtonsPanel" HorizontalAlignment="Center">
                            <Button Name="RemoveAll" Style="{StaticResource ResourceKey=ButtonStyle}"
                                    Click="RemoveAll_Click">
                                Remove all
                            </Button>
                            <Button Name="Submit" Style="{StaticResource ResourceKey=ButtonStyle}" 
                                    IsDefault="True"
                                    Click="Submit_Click">
                                Submit
                            </Button>                        
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </GroupBox>
            <GroupBox Visibility="Collapsed" Name="ResultsGroupBox">
                <GroupBox.Header>
                    <TextBlock Style="{StaticResource ResourceKey=GroupNameStyle}">
                        Last submit results
                    </TextBlock>
                </GroupBox.Header>

                <StackPanel>
                    <StackPanel Name="ProgressPanel" HorizontalAlignment="Center">
                        <TextBlock HorizontalAlignment="Center">Processing...</TextBlock>
                        <ProgressBar IsIndeterminate="True" MinWidth="200" Height="10" />
                        <Button Margin="5 5 5 10" Click="Cancel_Click">Cancel</Button>
                    </StackPanel>
                    <src:ActionGrid x:Name="ActionGrid" />
                </StackPanel>
            </GroupBox>
        </StackPanel>
    </ScrollViewer>
</UserControl>
